.class public Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader;
.super Ljava/lang/Object;
.source "SMSInfoReader.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader$SMSBroadcastReceiver;,
        Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader$SmsInfo;
    }
.end annotation


# static fields
.field private static final MESSAGE_READ:Ljava/lang/String; = "1"

.field private static final MESSAGE_UNREAD:Ljava/lang/String; = "0"

.field private static final MMS_CONTENT_URI:Landroid/net/Uri; = null

.field private static final PROJECTION_SMS_COUNT:[Ljava/lang/String; = null

.field private static final SMS_CONTENT_URI:Landroid/net/Uri; = null

.field private static final TAG:Ljava/lang/String; = "SmsInfoReader"


# instance fields
.field private mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

.field private mSMSBroadcastReceiver:Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader$SMSBroadcastReceiver;


# direct methods
.method static constructor <clinit>()V
    .locals 3

    .prologue
    .line 21
    const-string v0, "content://sms"

    invoke-static {v0}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v0

    sput-object v0, Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader;->SMS_CONTENT_URI:Landroid/net/Uri;

    .line 22
    const-string v0, "content://mms"

    invoke-static {v0}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v0

    sput-object v0, Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader;->MMS_CONTENT_URI:Landroid/net/Uri;

    .line 26
    const/4 v0, 0x1

    new-array v0, v0, [Ljava/lang/String;

    const/4 v1, 0x0

    const-string v2, "thread_id"

    aput-object v2, v0, v1

    sput-object v0, Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader;->PROJECTION_SMS_COUNT:[Ljava/lang/String;

    return-void
.end method

.method public constructor <init>(Lcom/nemustech/regina/ReginaLauncher;)V
    .locals 0
    .parameter "reginaLauncher"

    .prologue
    .line 31
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 32
    iput-object p1, p0, Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    .line 33
    return-void
.end method


# virtual methods
.method public getMissedMMSInfoCount()I
    .locals 9

    .prologue
    .line 107
    const/4 v6, 0x0

    .line 108
    .local v6, c:Landroid/database/Cursor;
    const/4 v7, 0x0

    .line 110
    .local v7, count:I
    :try_start_0
    iget-object v0, p0, Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    sget-object v1, Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader;->MMS_CONTENT_URI:Landroid/net/Uri;

    sget-object v2, Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader;->PROJECTION_SMS_COUNT:[Ljava/lang/String;

    const-string v3, "read=0"

    const/4 v4, 0x0

    const/4 v5, 0x0

    invoke-virtual/range {v0 .. v5}, Lcom/nemustech/regina/ReginaLauncher;->managedQuery(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v6

    .line 111
    invoke-interface {v6}, Landroid/database/Cursor;->getCount()I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result v7

    .line 115
    if-eqz v6, :cond_0

    invoke-interface {v6}, Landroid/database/Cursor;->close()V

    .line 117
    :cond_0
    :goto_0
    return v7

    .line 112
    :catch_0
    move-exception v0

    move-object v8, v0

    .line 113
    .local v8, e:Ljava/lang/Exception;
    :try_start_1
    invoke-virtual {v8}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 115
    if-eqz v6, :cond_0

    invoke-interface {v6}, Landroid/database/Cursor;->close()V

    goto :goto_0

    .end local v8           #e:Ljava/lang/Exception;
    :catchall_0
    move-exception v0

    if-eqz v6, :cond_1

    invoke-interface {v6}, Landroid/database/Cursor;->close()V

    :cond_1
    throw v0
.end method

.method public getMissedSMSInfoCount()I
    .locals 9

    .prologue
    .line 93
    const/4 v6, 0x0

    .line 94
    .local v6, c:Landroid/database/Cursor;
    const/4 v7, 0x0

    .line 96
    .local v7, count:I
    :try_start_0
    iget-object v0, p0, Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    sget-object v1, Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader;->SMS_CONTENT_URI:Landroid/net/Uri;

    sget-object v2, Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader;->PROJECTION_SMS_COUNT:[Ljava/lang/String;

    const-string v3, "read=0"

    const/4 v4, 0x0

    const/4 v5, 0x0

    invoke-virtual/range {v0 .. v5}, Lcom/nemustech/regina/ReginaLauncher;->managedQuery(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v6

    .line 97
    invoke-interface {v6}, Landroid/database/Cursor;->getCount()I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result v7

    .line 101
    if-eqz v6, :cond_0

    invoke-interface {v6}, Landroid/database/Cursor;->close()V

    .line 103
    :cond_0
    :goto_0
    return v7

    .line 98
    :catch_0
    move-exception v0

    move-object v8, v0

    .line 99
    .local v8, e:Ljava/lang/Exception;
    :try_start_1
    invoke-virtual {v8}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 101
    if-eqz v6, :cond_0

    invoke-interface {v6}, Landroid/database/Cursor;->close()V

    goto :goto_0

    .end local v8           #e:Ljava/lang/Exception;
    :catchall_0
    move-exception v0

    if-eqz v6, :cond_1

    invoke-interface {v6}, Landroid/database/Cursor;->close()V

    :cond_1
    throw v0
.end method

.method public getMissedSMSInfoList(Ljava/util/List;)V
    .locals 10
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List",
            "<",
            "Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader$SmsInfo;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 57
    .local p1, smsInfoList:Ljava/util/List;,"Ljava/util/List<Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader$SmsInfo;>;"
    const/4 v6, 0x0

    .line 59
    .local v6, c:Landroid/database/Cursor;
    :try_start_0
    iget-object v0, p0, Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader;->mReginaLauncher:Lcom/nemustech/regina/ReginaLauncher;

    sget-object v1, Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader;->SMS_CONTENT_URI:Landroid/net/Uri;

    const/4 v2, 0x0

    const/4 v3, 0x0

    const/4 v4, 0x0

    const/4 v5, 0x0

    invoke-virtual/range {v0 .. v5}, Lcom/nemustech/regina/ReginaLauncher;->managedQuery(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v6

    .line 60
    invoke-interface {v6}, Landroid/database/Cursor;->getCount()I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result v0

    if-gtz v0, :cond_1

    .line 88
    if-eqz v6, :cond_0

    invoke-interface {v6}, Landroid/database/Cursor;->close()V

    .line 90
    :cond_0
    :goto_0
    return-void

    .line 62
    :cond_1
    :try_start_1
    invoke-interface {v6}, Landroid/database/Cursor;->moveToFirst()Z

    .line 64
    :cond_2
    const-string v0, "read"

    invoke-interface {v6, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {v6, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    const-string v1, "0"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_3

    .line 65
    new-instance v9, Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader$SmsInfo;

    invoke-direct {v9, p0}, Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader$SmsInfo;-><init>(Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader;)V

    .line 66
    .local v9, smsInfo:Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader$SmsInfo;
    const-string v0, "thread_id"

    invoke-interface {v6, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {v6, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, v9, Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader$SmsInfo;->mSmsThreadId:Ljava/lang/String;

    .line 67
    const-string v0, "address"

    invoke-interface {v6, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {v6, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, v9, Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader$SmsInfo;->mSmsAddress:Ljava/lang/String;

    .line 68
    const-string v0, "person"

    invoke-interface {v6, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {v6, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, v9, Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader$SmsInfo;->mSmsPerson:Ljava/lang/String;

    .line 70
    new-instance v8, Ljava/text/SimpleDateFormat;

    const-string v0, "yyyy/MM/dd"

    invoke-direct {v8, v0}, Ljava/text/SimpleDateFormat;-><init>(Ljava/lang/String;)V

    .line 71
    .local v8, sdf:Ljava/text/SimpleDateFormat;
    new-instance v0, Ljava/util/Date;

    const-string v1, "date"

    invoke-interface {v6, v1}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v1

    invoke-interface {v6, v1}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v1

    invoke-direct {v0, v1, v2}, Ljava/util/Date;-><init>(J)V

    invoke-virtual {v8, v0}, Ljava/text/SimpleDateFormat;->format(Ljava/util/Date;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, v9, Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader$SmsInfo;->mSmsDate:Ljava/lang/String;

    .line 72
    const-string v0, "read"

    invoke-interface {v6, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {v6, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, v9, Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader$SmsInfo;->mSmsRead:Ljava/lang/String;

    .line 73
    const-string v0, "protocol"

    invoke-interface {v6, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {v6, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, v9, Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader$SmsInfo;->mSmsProtocol:Ljava/lang/String;

    .line 74
    const-string v0, "status"

    invoke-interface {v6, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {v6, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, v9, Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader$SmsInfo;->mSmsStatus:Ljava/lang/String;

    .line 75
    const-string v0, "type"

    invoke-interface {v6, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {v6, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, v9, Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader$SmsInfo;->mSmsType:Ljava/lang/String;

    .line 76
    const-string v0, "reply_path_present"

    invoke-interface {v6, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {v6, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, v9, Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader$SmsInfo;->mSmsReplyPathPresent:Ljava/lang/String;

    .line 77
    const-string v0, "subject"

    invoke-interface {v6, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {v6, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, v9, Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader$SmsInfo;->mSmsSubject:Ljava/lang/String;

    .line 78
    const-string v0, "body"

    invoke-interface {v6, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {v6, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, v9, Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader$SmsInfo;->mSmsBody:Ljava/lang/String;

    .line 79
    const-string v0, "service_center"

    invoke-interface {v6, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {v6, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, v9, Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader$SmsInfo;->mSmsServiceCenter:Ljava/lang/String;

    .line 80
    const-string v0, "locked"

    invoke-interface {v6, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {v6, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, v9, Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader$SmsInfo;->mSmsLocked:Ljava/lang/String;

    .line 82
    invoke-interface {p1, v9}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 84
    .end local v8           #sdf:Ljava/text/SimpleDateFormat;
    .end local v9           #smsInfo:Lcom/nemustech/regina/widgets/missednoti/SMSInfoReader$SmsInfo;
    :cond_3
    invoke-interface {v6}, Landroid/database/Cursor;->moveToNext()Z
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    move-result v0

    if-nez v0, :cond_2

    .line 88
    if-eqz v6, :cond_0

    invoke-interface {v6}, Landroid/database/Cursor;->close()V

    goto/16 :goto_0

    .line 85
    :catch_0
    move-exception v0

    move-object v7, v0

    .line 86
    .local v7, e:Ljava/lang/Exception;
    :try_start_2
    invoke-virtual {v7}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    .line 88
    if-eqz v6, :cond_0

    invoke-interface {v6}, Landroid/database/Cursor;->close()V

    goto/16 :goto_0

    .end local v7           #e:Ljava/lang/Exception;
    :catchall_0
    move-exception v0

    if-eqz v6, :cond_4

    invoke-interface {v6}, Landroid/database/Cursor;->close()V

    :cond_4
    throw v0
.end method
